<%-- 
    Document   : showHospitals
    Created on : 29 Oct, 2012, 5:56:05 PM
    Author     : sagar
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@include file="../common/script.jsp" %>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="../js/markerclusterer.js"></script>
<script type="text/javascript">
    var geocoder;
    var map;
    var i;
    var j;
    var k;
    var ltlng = [];
    var hopsitalName=[];
    var hopsitalAddress=[];
    var HospitalContact1=[];
    var HospitalContact2=[];
    var HospitalContact3=[];
    var icon_green_L = '../images/icon_green_L.png';
    var icon_green_plus = '../images/icon_green_plus.png';
    var icon_white_L = '../images/icon_white_L.png';
    var icon_white_plus = '../images/icon_white_plus.png';
    var icon_green_D='../images/icon_green_D.png';
    var icon_white_D='../images/icon_white_D.png';
    var hospital_icon = '../images/hospital_icon.png';
    var hospital_person='../images/hospital_person.png';
    var icon_yellow_H='../images/Healthspring_map_tags.png';
    var infowindow = new google.maps.InfoWindow({content: 'Location info:Country Name:LatLng:'});
    var infowindowHosp = new google.maps.InfoWindow({content: 'Location info:Country Name:LatLng:'});
    var marker;
    var markerPosition;
    var level=[];
    var tieUpStage=[];
    var mapOptions;
    var locumName=[];
    var locumAddress=[];
    var locumContact1=[];
    var locumContact2=[];
    var locumLtlng=[];
    
    //newly added
    var hstLocumName=[];
    var hstLocumAddress=[];
    var hstLocumContact1=[];
    var hstLocumContact2=[];
    var hstLocumLtlng=[];
    
    var isInsurance=[];
    var depositLess=[];
    var locumType=[];
    // newly added
    var hstLocumType=[];
    var speciality=[];
    var centerName=[];
    var centerLtlng=[];
    var centerAddress=[];
    var centerPhoneNumber=[];
    var cluserMarker=[]; 
    var markerCluster;
    var hospitalTieupLombardCluserMarker=[];
    var hospitalTieupCluserMarker=[];
    var hospitalLombardCluserMarker=[];
    var hospitalCluserMarker=[]; 
    var hospitalMarkerCluster;
    var hospitalTieupLombardMarkerCluster;
    var hospitalTieupMarkerCluster;
    var hospitalLombardMarkerCluster;
    
    
    var centerCluserMarker=[]; 
    var centerMarkerCluster;
    var locumCluserMarker=[]; 
    var locumMarkerCluster;
    
    //newly added
    var hstlocumCluserMarker=[]; 
    var hstlocumMarkerCluster;
    
    
    
    // tie-up hospital and insurance
    var levelTieUpInsurance=[];
    var tieUpStageTieUpInsurance=[];
    var hopsitalNameTieUpInsurance=[];
    var hopsitalAddressTieUpInsurance=[];
    var HospitalContact1TieUpInsurance=[];
    var HospitalContact2TieUpInsurance=[];
    var HospitalContact3TieUpInsurance=[];
    var isInsuranceTieUpInsurance=[];
    var specialityTieUpInsurance=[];
    var depositLessTieUpInsurance=[];
    var ltlngTieUpInsurance=[];
    // tie-up hospital and insurance
    
    
    // tie-up hospital not insurance
    var levelTieUpNotInsurance=[];
    var tieUpStageTieUpNotInsurance=[];
    var hopsitalNameTieUpNotInsurance=[];
    var hopsitalAddressTieUpNotInsurance=[];
    var HospitalContact1TieUpNotInsurance=[];
    var HospitalContact2TieUpNotInsurance=[];
    var HospitalContact3TieUpNotInsurance=[];
    var isInsuranceTieUpNotInsurance=[];
    var specialityTieUpNotInsurance=[];
    var depositLessTieUpNotInsurance=[];
    var ltlngTieUpNotInsurance=[];
    // tie-up hospital not insurance
    
    // not tie-up hospital  insurance
    var levelNotTieUpInsurance=[];
    var tieUpStageNotTieUpInsurance=[];
    var hopsitalNameNotTieUpInsurance=[];
    var hopsitalAddressNotTieUpInsurance=[];
    var HospitalContact1NotTieUpInsurance=[];
    var HospitalContact2NotTieUpInsurance =[];
    var HospitalContact3NotTieUpInsurance=[];
    var isInsuranceNotTieUpInsurance=[];
    var specialityNotTieUpInsurance=[];
    var depositLessNotTieUpInsurance=[];
    var ltlngNotTieUpInsurance=[];
    // not tie-up hospital  insurance
    <c:forEach items="${hospitalList}"  var="item2" varStatus="yy">
        <c:choose>
            <c:when test="${item2.tieUpStage==3 && item2.isInsurance==true}" >
                levelTieUpInsurance.push("${item2.level}");
                tieUpStageTieUpInsurance.push("${item2.tieUpStage}");
                hopsitalNameTieUpInsurance.push("${item2.hospitalName}");   
                hopsitalAddressTieUpInsurance.push("${item2.hospitalAddress}");
                HospitalContact1TieUpInsurance.push("${item2.contact1}");
                HospitalContact2TieUpInsurance.push("${item2.contact2}");
                HospitalContact3TieUpInsurance.push("${item2.contact3}");
                isInsuranceTieUpInsurance.push("${item2.isInsurance}");
                specialityTieUpInsurance.push("${item2.speciality}");
                depositLessTieUpInsurance.push("${item2.depositLess}");
                ltlngTieUpInsurance.push(new google.maps.LatLng(${item2.latitude}, ${item2.longitude}));
            </c:when>
            <c:when test="${item2.tieUpStage==3 && item2.isInsurance==false}" >
                levelTieUpNotInsurance.push("${item2.level}");
                tieUpStageTieUpNotInsurance.push("${item2.tieUpStage}");
                hopsitalNameTieUpNotInsurance.push("${item2.hospitalName}");
                hopsitalAddressTieUpNotInsurance.push("${item2.hospitalAddress}");
                HospitalContact1TieUpNotInsurance.push("${item2.contact1}");
                HospitalContact2TieUpNotInsurance.push("${item2.contact2}");
                HospitalContact3TieUpNotInsurance.push("${item2.contact3}");
                isInsuranceTieUpNotInsurance.push("${item2.isInsurance}");
                specialityTieUpNotInsurance.push("${item2.speciality}");
                depositLessTieUpNotInsurance.push("${item2.depositLess}");
                ltlngTieUpNotInsurance.push(new google.maps.LatLng(${item2.latitude}, ${item2.longitude}));
            </c:when>
            <c:when test="${item2.tieUpStage<3 && item2.isInsurance==true}" >
                levelNotTieUpInsurance.push("${item2.level}");
                tieUpStageNotTieUpInsurance.push("${item2.tieUpStage}");
                hopsitalNameNotTieUpInsurance.push("${item2.hospitalName}");
                hopsitalAddressNotTieUpInsurance.push("${item2.hospitalAddress}");
                HospitalContact1NotTieUpInsurance.push("${item2.contact1}");
                HospitalContact2NotTieUpInsurance.push("${item2.contact2}");
                HospitalContact3NotTieUpInsurance.push("${item2.contact3}");
                isInsuranceNotTieUpInsurance.push("${item2.isInsurance}");
                specialityNotTieUpInsurance.push("${item2.speciality}");
                depositLessNotTieUpInsurance.push("${item2.depositLess}");
                ltlngNotTieUpInsurance.push(new google.maps.LatLng(${item2.latitude}, ${item2.longitude}));
            </c:when>
            <c:otherwise>
                level.push("${item2.level}");
                tieUpStage.push("${item2.tieUpStage}");
                hopsitalName.push("${item2.hospitalName}");
                hopsitalAddress.push("${item2.hospitalAddress}");
                HospitalContact1.push("${item2.contact1}");
                HospitalContact2.push("${item2.contact2}");
                HospitalContact3.push("${item2.contact3}");
                isInsurance.push("${item2.isInsurance}");
                speciality.push("${item2.speciality}");
                depositLess.push("${item2.depositLess}");
                ltlng.push(new google.maps.LatLng(${item2.latitude}, ${item2.longitude})); 
            </c:otherwise>
        </c:choose>
    </c:forEach>
    <c:forEach items="${locumList}"  var="item1" varStatus="yy">
        
            <c:if test="${item1.locumType =='HS'}">
                locumName.push("${item1.locumName}");
                locumAddress.push("${item1.address}");
                locumContact1.push("${item1.contact1}");
                locumContact2.push("${item1.contact2}");
                locumType.push("${item1.locumType}");
                locumLtlng.push(new google.maps.LatLng(${item1.latitude}, ${item1.longitude}));
            </c:if>
            <c:if test="${item1.locumType =='HST'}">
                hstLocumName.push("${item1.locumName}");
                hstLocumAddress.push("${item1.address}");
                hstLocumContact1.push("${item1.contact1}");
                hstLocumContact2.push("${item1.contact2}");
                hstLocumType.push("${item1.locumType}");
                hstLocumLtlng.push(new google.maps.LatLng(${item1.latitude}, ${item1.longitude}));
            </c:if>
    </c:forEach>
        
    <c:forEach items="${centerList}"  var="item3" varStatus="yy">
        centerName.push("${item3.centerName}");
        centerAddress.push("${item3.address}");
        centerPhoneNumber.push("${item3.phoneNumber}");
        centerLtlng.push(new google.maps.LatLng(${item3.latitude}, ${item3.longitude}));
        
    </c:forEach>

        function initialize() {
            geocoder = new google.maps.Geocoder();
            var latlng = new google.maps.LatLng(19.0759837,72.87765590000004);
            mapOptions = {
                zoom: 13,
                center: latlng,
                mapTypeId: google.maps.MapTypeId.ROADMAP
            }
            map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);
            //GEOCODER
            geocoder = new google.maps.Geocoder();
            markicons();
        }
        function markicons() {
            markerPosition = new google.maps.Marker({
                map: map,
                draggable: false,
                icon :hospital_person
            });
            var hsp='hospitalTieupLombard';
            show(hsp);
            
        }
        $(document).ready(function() {
            $(function() {
              
        
                $("#address").autocomplete({
        
                    //This bit uses the geocoder to fetch address values
                    source: function(request, response) {
               
                        geocoder.geocode( {
                            'address': request.term
                        }, function(results, status) {
                
                            response($.map(results, function(item) {
                                return {
                                    label:  item.formatted_address,
                                    value: item.formatted_address,
                                    latitude: item.geometry.location.lat(),
                                    longitude: item.geometry.location.lng()
                                }
                            }));
                        })
                    },
                    //This bit is executed upon selection of an address
                    select: function(event, ui) {
                        $("#latitude").val(ui.item.latitude);
                        $("#longitude").val(ui.item.longitude);
                        var location = new google.maps.LatLng(ui.item.latitude, ui.item.longitude);
                        markerPosition.setPosition(location);
                        map.setCenter(location);
                    }
                    
                });
                google.maps.event.addListener(markerPosition, 'drag', function() {
                    geocoder.geocode({
                        'latLng': markerPosition.getPosition()
                    }, function(results, status) {
                        if (status == google.maps.GeocoderStatus.OK) {
                            if (results[0]) {
                                $('#address').val(results[0].formatted_address);
                                $('#latitude').val(markerPosition.getPosition().lat());
                                $('#longitude').val(markerPosition.getPosition().lng());
                            }
                        }
                    });
                });
            });
        });
        google.maps.event.addDomListener(window, 'load', initialize);
        function boxclick(box,category){
            if (box.checked) {
                show(category);
            }else{
                hide(category);
            }
        }
        function show(category){
            // alert('category = '+category);
            if(category=='hospitalTieupLombard'){
                hospitalTieupLombardCluserMarker=[];
                //  alert('hospitalTieupLombard = '+category);
                
                for (i = 0; i <= ltlngTieUpInsurance.length-1; i++) {
                    marker = new google.maps.Marker({
                        map: map,
                        position: ltlngTieUpInsurance[i],
                        title:"Click me",
                        icon : icon_green_L
                    });        
                    (function (i, marker) {

                        google.maps.event.addListener(marker, 'click', function () {
                            if (!infowindow) {
                                infowindow = new google.maps.InfoWindow();
                            }
                            var flag;
                            if(depositLessTieUpInsurance[i]=='true'){
                                flag='Yes';
                            }else{
                                flag='No';
                            }
                            var content = "<table style=\"font-size:13px;\" width=\"450\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n\
                <tr>\n\
<td width=\"402\"  align=\"left\" valign=\"top\"><strong>Name</strong> :-<br /> "+hopsitalNameTieUpInsurance[i]+"</td>\n\
<td width=\"402\"  align=\"left\" valign=\"top\"><strong>Contact</strong> :-<br />"+HospitalContact1TieUpInsurance[i]+",&nbsp;<br />"+HospitalContact2TieUpInsurance[i]+",&nbsp;<br />"+HospitalContact3TieUpInsurance[i]+"</td>\n\
<td width=\"402\"  align=\"left\" valign=\"top\"><strong>Address</strong> :-<br /> "+hopsitalAddressTieUpInsurance[i]+"</td></tr>\n\
<tr><td align=\"left\" valign=\"top\"><strong>Level</strong> :- "+levelTieUpInsurance[i]+"</td><td rowspan=\"2\" width=\"402\"  align=\"left\" valign=\"top\"><strong>Speciality</strong> :-<br /> "+specialityTieUpInsurance[i]+"</td>\n\
<td rowspan=\"2\" width=\"402\"  align=\"left\" valign=\"top\"><strong>Depositless</strong> :-<br /> "+flag+"</td></tr></table>";
                                        
                            infowindow.setContent(content);
                            infowindow.open(map, marker);
                        });
                    })(i, marker);
                    marker.myCategory=category;
                    hospitalTieupLombardCluserMarker.push(marker);
                }
          
                hospitalTieupLombardMarkerCluster = new MarkerClusterer(map, hospitalTieupLombardCluserMarker, mapOptions);       
            }else if(category=='hospitalTieup'){
                hospitalTieupCluserMarker=[];
               
                // alert('hospitalTieup = '+category);
               
                for (i = 0; i <= ltlngTieUpNotInsurance.length-1; i++) {
                    marker = new google.maps.Marker({
                        map: map,
                        position: ltlngTieUpNotInsurance[i],
                        title:"Click me",
                        icon : icon_green_plus
                    });        
                    (function (i, marker) {

                        google.maps.event.addListener(marker, 'click', function () {
                            if (!infowindow) {
                                infowindow = new google.maps.InfoWindow();
                            }
                            var flag;
                            if(depositLessTieUpNotInsurance[i]=='true'){
                                flag='Yes';
                            }else{
                                flag='No';
                            }
                            var content = "<table style=\"font-size:13px;\" width=\"450\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n\
                <tr>\n\
<td width=\"402\"  align=\"left\" valign=\"top\"><strong>Name</strong> :-<br /> "+hopsitalNameTieUpNotInsurance[i]+"</td>\n\
<td width=\"402\"  align=\"left\" valign=\"top\"><strong>Contact</strong> :-<br />"+HospitalContact1TieUpNotInsurance[i]+",&nbsp;<br />"+HospitalContact2TieUpNotInsurance[i]+",&nbsp;<br />"+HospitalContact3TieUpNotInsurance[i]+"</td>\n\
<td width=\"402\"  align=\"left\" valign=\"top\"><strong>Address</strong> :-<br /> "+hopsitalAddressTieUpNotInsurance[i]+"</td></tr>\n\
<tr><td align=\"left\" valign=\"top\"><strong>Level</strong> :- "+levelTieUpNotInsurance[i]+"</td><td rowspan=\"2\" width=\"402\"  align=\"left\" valign=\"top\"><strong>Speciality</strong> :-<br /> "+specialityTieUpNotInsurance[i]+"</td>\n\
<td rowspan=\"2\" width=\"402\"  align=\"left\" valign=\"top\"><strong>Depositless</strong> :-<br /> "+flag+"</td></tr></table>";
                                        
                            infowindow.setContent(content);
                            infowindow.open(map, marker);
                        });
                    })(i, marker);
                    marker.myCategory=category;
                    hospitalTieupCluserMarker.push(marker);
                }
               
                hospitalTieupMarkerCluster = new MarkerClusterer(map, hospitalTieupCluserMarker, mapOptions);       
            }else if(category=='hospitalLombard'){
                hospitalLombardCluserMarker=[];
                //  alert('hospitalLombard = '+category);
                
                
                for (i = 0; i <= ltlngNotTieUpInsurance.length-1; i++) {
                    marker = new google.maps.Marker({
                        map: map,
                        position: ltlngNotTieUpInsurance[i],
                        title:"Click me",
                        icon : icon_white_L
                    });        
                    (function (i, marker) {

                        google.maps.event.addListener(marker, 'click', function () {
                            if (!infowindow) {
                                infowindow = new google.maps.InfoWindow();
                            }
                            var flag;
                            if(depositLessNotTieUpInsurance[i]=='true'){
                                flag='Yes';
                            }else{
                                flag='No';
                            }
                            var content = "<table style=\"font-size:13px;\" width=\"450\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n\
                <tr>\n\
<td width=\"402\"  align=\"left\" valign=\"top\"><strong>Name</strong> :-<br /> "+hopsitalNameNotTieUpInsurance[i]+"</td>\n\
<td width=\"402\"  align=\"left\" valign=\"top\"><strong>Contact</strong> :-<br />"+HospitalContact1NotTieUpInsurance[i]+",&nbsp;<br />"+HospitalContact2NotTieUpInsurance[i]+",&nbsp;<br />"+HospitalContact3NotTieUpInsurance[i]+"</td>\n\
<td width=\"402\"  align=\"left\" valign=\"top\"><strong>Address</strong> :-<br /> "+hopsitalAddressNotTieUpInsurance[i]+"</td></tr>\n\
<tr><td align=\"left\" valign=\"top\"><strong>Level</strong> :- "+levelNotTieUpInsurance[i]+"</td><td rowspan=\"2\" width=\"402\"  align=\"left\" valign=\"top\"><strong>Speciality</strong> :-<br /> "+specialityNotTieUpInsurance[i]+"</td>\n\
<td rowspan=\"2\" width=\"402\"  align=\"left\" valign=\"top\"><strong>Depositless</strong> :-<br /> "+flag+"</td></tr></table>";
                                        
                            infowindow.setContent(content);
                            infowindow.open(map, marker);
                        });
                    })(i, marker);
                    marker.myCategory=category;
                    hospitalLombardCluserMarker.push(marker);
                }
               
                
                
                hospitalLombardMarkerCluster = new MarkerClusterer(map, hospitalLombardCluserMarker, mapOptions);       
            }else if(category=='hospital'){
                // alert('hospitalLombard = '+category);
                hospitalCluserMarker=[];
                for (i = 0; i <= ltlng.length-1; i++) {
                  
                  
                    marker = new google.maps.Marker({
                        map: map,
                        position: ltlng[i],
                        title:"Click me",
                        icon : icon_white_plus
                    });     
                    
                    (function (i, marker) {

                        google.maps.event.addListener(marker, 'click', function () {
                            if (!infowindow) {
                                infowindow = new google.maps.InfoWindow();
                            }
                            var flag;
                            if(depositLess[i]=='true'){
                                flag='Yes';
                            }else{
                                flag='No';
                            }
                            var content = "<table style=\"font-size:13px;\" width=\"450\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n\
                <tr>\n\
<td width=\"402\"  align=\"left\" valign=\"top\"><strong>Name</strong> :-<br /> "+hopsitalName[i]+"</td>\n\
<td width=\"402\"  align=\"left\" valign=\"top\"><strong>Contact</strong> :-<br />"+HospitalContact1[i]+",&nbsp;<br />"+HospitalContact2[i]+",&nbsp;<br />"+HospitalContact3[i]+"</td>\n\
<td width=\"402\"  align=\"left\" valign=\"top\"><strong>Address</strong> :-<br /> "+hopsitalAddress[i]+"</td></tr>\n\
<tr><td align=\"left\" valign=\"top\"><strong>Level</strong> :- "+level[i]+"</td><td rowspan=\"2\" width=\"402\"  align=\"left\" valign=\"top\"><strong>Speciality</strong> :-<br /> "+speciality[i]+"</td>\n\
<td rowspan=\"2\" width=\"402\"  align=\"left\" valign=\"top\"><strong>Depositless</strong> :-<br /> "+flag+"</td></tr></table>";
                                        
                            infowindow.setContent(content);
                            infowindow.open(map, marker);
                        });
                    })(i, marker);
                    marker.myCategory=category;
                    hospitalCluserMarker.push(marker);
                }
                
                hospitalMarkerCluster = new MarkerClusterer(map, hospitalCluserMarker, mapOptions);       
                
            }else if(category=='locum'){
                locumCluserMarker=[];
                for (j = 0; j <= locumLtlng.length-1; j++) {
            
                    marker = new google.maps.Marker({
                        map: map,
                        position: locumLtlng[j],
                        title:"Click me",
                        icon : icon_green_D  
                    });
                
                    (function (j, marker) {

                        google.maps.event.addListener(marker, 'click', function () {
                            if (!infowindow) {
                                infowindow = new google.maps.InfoWindow();
                            }
                 
                            var content = "<table style=\"font-size:13px;\" width=\"450\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n\
<tr><td width=\"402\" align=\"left\" valign=\"top\"><strong>Locum name</strong> :-<br /> "+locumName[j]+"</td>\n\
    <td width=\"402\" align=\"left\" valign=\"top\"><strong>Address</strong> :-<br /> "+locumAddress[j]+"</td></tr>\n\
<tr><td width=\"402\" align=\"left\" valign=\"top\"><strong>Contact</strong> :-<br /> "+locumContact1[j]+",&nbsp<br />"+locumContact2[j]+"</td></tr>\n\
</table>";
                                        
                            infowindow.setContent(content);
                            infowindow.open(map, marker);
                        });
                    })(j, marker);
                    marker.myCategory=category;
                    locumCluserMarker.push(marker);
                }
                locumMarkerCluster = new MarkerClusterer(map, locumCluserMarker, mapOptions);       
                
                
            }else if(category=='hstlocum'){
                hstlocumCluserMarker=[];
                for (j = 0; j <= hstLocumLtlng.length-1; j++) {
            
                    marker = new google.maps.Marker({
                        map: map,
                        position: hstLocumLtlng[j],
                        title:"Click me",
                        icon : icon_white_D 
                    });
                
                    (function (j, marker) {

                        google.maps.event.addListener(marker, 'click', function () {
                            if (!infowindow) {
                                infowindow = new google.maps.InfoWindow();
                            }
                 
                            var content = "<table style=\"font-size:13px;\" width=\"450\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n\
<tr><td width=\"402\" align=\"left\" valign=\"top\"><strong>Locum name</strong> :-<br /> "+hstLocumName[j]+"</td>\n\
    <td width=\"402\" align=\"left\" valign=\"top\"><strong>Address</strong> :-<br /> "+hstLocumAddress[j]+"</td></tr>\n\
<tr><td width=\"402\" align=\"left\" valign=\"top\"><strong>Contact</strong> :-<br /> "+hstLocumContact1[j]+",&nbsp<br />"+hstLocumContact2[j]+"</td></tr>\n\
</table>";
                                        
                            infowindow.setContent(content);
                            infowindow.open(map, marker);
                        });
                    })(j, marker);
                    marker.myCategory=category;
                    hstlocumCluserMarker.push(marker);
                }
                hstlocumMarkerCluster = new MarkerClusterer(map, hstlocumCluserMarker, mapOptions);       
                
                
            }
            
            else{
                centerCluserMarker=[];
                for (k = 0; k <= centerLtlng.length-1; k++) {
                    //alert("inside k");
     
                    marker = new google.maps.Marker({
                        map: map,
                        position: centerLtlng[k],
                        title:"Click me",
                        icon : icon_yellow_H
                        
                    });
                    (function (k, marker) {

                        google.maps.event.addListener(marker, 'click', function () {
                            if (!infowindow) {
                                infowindow = new google.maps.InfoWindow();
                            }
                 
                            var content = "<table style=\"font-size:13px;\" width=\"450\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n\
<tr>\n\
<td width=\"402\" align=\"left\" valign=\"top\"><strong>Healthspring Community Medical Centre</strong> :-<br> "+centerName[k]+"</td>\n\
<td width=\"402\" align=\"left\" valign=\"top\"><strong>Address</strong> :-<br> "+centerAddress[k]+"</td>\n\
<td width=\"402\" align=\"left\" valign=\"top\"><strong>Phone No.</strong> :-<br> "+centerPhoneNumber[k]+"</td></tr>\n\
</table>";
                                        
                            infowindow.setContent(content);
                            infowindow.open(map, marker);
                        });
                    })(k, marker);
                    marker.myCategory=category;
                    centerCluserMarker.push(marker);
                }
                centerMarkerCluster = new MarkerClusterer(map, centerCluserMarker, mapOptions);
            }
          
        }
        function hide(category){
            if(category=='hospitalTieupLombard'){
                var m=[];
                m= hospitalTieupLombardMarkerCluster.getMarkers();
                var temp=m.length;
                for(var z=temp-1;z>=0;z--){
                    hospitalTieupLombardMarkerCluster.removeMarker(m[z]);              
                }
            }
            if(category=='hospitalTieup'){
                var m=[];
                m= hospitalTieupMarkerCluster.getMarkers();
                var temp=m.length;
                for(var z=temp-1;z>=0;z--){
                    hospitalTieupMarkerCluster.removeMarker(m[z]);              
                }
            }
            if(category=='hospitalLombard'){
                var m=[];
                m= hospitalLombardMarkerCluster.getMarkers();
                var temp=m.length;
                for(var z=temp-1;z>=0;z--){
                    hospitalLombardMarkerCluster.removeMarker(m[z]);              
                }
            }
            if(category=='hospital'){
                var m=[];
                m= hospitalMarkerCluster.getMarkers();
                var temp=m.length;
                for(var z=temp-1;z>=0;z--){
                    hospitalMarkerCluster.removeMarker(m[z]);              
                }
            }
            if(category=='locum'){
                var m=[];
                m= locumMarkerCluster.getMarkers();
                var temp=m.length;
                for(var z=temp-1;z>=0;z--){
                    locumMarkerCluster.removeMarker(m[z]);              
                }
            }
            if(category=='hstlocum'){
                var m=[];
                m= hstlocumMarkerCluster.getMarkers();
                var temp=m.length;
                for(var z=temp-1;z>=0;z--){
                    hstlocumMarkerCluster.removeMarker(m[z]);              
                }
            }
            
            if(category=='center'){
                var m=[];
                m= centerMarkerCluster.getMarkers();
                var temp=m.length;
                for(var z=temp-1;z>=0;z--){
                    centerMarkerCluster.removeMarker(m[z]);              
                } 
            }
        }
       
</script>

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <%@include file="../common/title.jsp" %>
    </head>
    <body>
        <%@include file="../common/header.jsp" %>
        <%@include file="../common/menu.jsp" %>
        <!--        <div style="width: 40%; position: relative; padding-top:20px; top:10px; left:20px; font:normal 12px/normal Arial;">-->
        <div style="width: 100%;  position: absolute; top:95px; left:0px; font:normal 12px/normal Arial;">
            <%@include file="../common/message.jsp" %>
            <form id="form1" name="form1" method="POST" >
                <input name="latitude" id="latitude" type="hidden"/><br/><br />
                <input name="longitude" id="longitude" type="hidden"/>
                <table width="100%">
                    <tr>
                        <td width="5%"  style="vertical-align: top">
                            Address:

                        </td>
                        <td width="75%">
                            <textarea cols="40" name="address" id="address" type="text" style="height:50px; padding: 10px; font-size: 16px; " ></textarea><br/>
                            <span id="errorsDiv_address"></span><br/>
                        </td>
                    </tr>
                </table>                
                <div style="width:60%; position: relative; float: left;  left:6px; font:normal 12px/normal Arial;">
                    <div id="map_canvas" style="float:left; position: relative; width: 100%;"></div><br/>
                </div>

                <div style="width:auto; height:auto; margin:0; padding:0; position: absolute; top:137px; left:820px;">
                    <table class="map_data" >
                        <tbody>
                            <tr>
                                <td><img src="../images/icon_green_L.png" alt="Tie up stage 3 & insurance" ></td>
                                <td><input type="checkbox" id="hospitalTieupLombard" checked="true" onclick="boxclick(this,'hospitalTieupLombard')"/></td>
                                <td>Healthspring Tieup Hospitals & Lombard Cashless</td>
                            </tr>
                            <tr>
                                <td><img src="../images/icon_green_plus.png" alt="Tie up stage 3" ></td>
                                <td><input type="checkbox" id="hospitalTieup"  onclick="boxclick(this,'hospitalTieup')"/></td>
                                <td>Healthspring Tieup Hospitals</td>
                            </tr>
                            <tr>
                                <td><img src="../images/icon_white_L.png" alt="Insurance" ></td>
                                <td><input type="checkbox" id="hospitalLombard" onclick="boxclick(this,'hospitalLombard')"/></td>
                                <td>Lombard Cashless</td>
                            </tr>
                            <tr>
                                <td><img src="../images/icon_white_plus.png" alt="None" ></td>
                                <td><input type="checkbox" id="hospital"  onclick="boxclick(this,'hospital')"/></td>
                                <td>Other Hospitals</td>
                            </tr>
                            <tr>
                                <td><img src="../images/icon_green_D.png" alt="Healthspring Locums" ></td>
                                <td><input type="checkbox" id="locum" onclick="boxclick(this,'locum')" /></td>
                                <td>Centre Physician</td>
                            </tr>
                            <tr>
                                <td><img src="../images/icon_white_D.png" alt=" Non Healthspring Locums" ></td>
                                <td><input type="checkbox" id="hstlocum" onclick="boxclick(this,'hstlocum')" /></td>
                                <td>Locum</td>
                            </tr>
                            <tr>
                                <td><img src="../images/Healthspring_map_tags.png" alt="Healthspring community Medical Center" ></td>
                                <td> <input type="checkbox" id="center" onclick="boxclick(this,'center')" /></td>
                                <td>Healthspring community Medical Centres</td>
                            </tr>
                        </tbody>
                    </table>
                    <div id="ambulanceList">
                        <table width="96%" border="1px" class="data_table">
                            <tr class="header">
                                <th></th>
                                <th><spring:message code="companyName"/></th>
                                <th><spring:message code="contact1"/></th>
                                <th><spring:message code="contact2"/></th>
                                <th><spring:message code="contact3"/></th>
                            </tr>
                            <c:forEach items="${ambulanceList}" var="userItem">
                                <tr>
                                    <td align="center"><img src="../images/ambulance_icon.png" style="border: none" /></td>
                                    <td align="center"><c:out value="${userItem.companyName}"/></td>
                                    <td align="center"><c:out value="${userItem.contact1}"/></td>
                                    <td align="center"><c:out value="${userItem.contact2}"/></td>
                                    <td align="center"><c:out value="${userItem.contact3}"/></td>
                                </tr>
                            </c:forEach>
                        </table>
                    </div>
                </div>

            </form>
        </div>  
    </body>
</html>